USE [NguyenHoa]
GO

-------------------------------------------------------------
--			@tblHtmlContent
-------------------------------------------------------------
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = object_id(N'[dbo].[_tblHtmlContent_GetByTypeAndLanguage]') AND type IN (N'P', N'PC'))
DROP PROCEDURE [dbo].[_tblHtmlContent_GetByTypeAndLanguage]
GO

CREATE PROCEDURE [dbo].[_tblHtmlContent_GetByTypeAndLanguage]
(
	@TypeId			INT,
	@LanguageId INT
)
AS
	SELECT *
	FROM tblHtmlContent 
	WHERE [TypeId] = @TypeId
				AND (@LanguageId IS NULL OR [LanguageId] = @LanguageId)
GO
-------------------------------------------------------------

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = object_id(N'[dbo].[_tblHtmlContent_GetIntroAtHomePage]') AND type IN (N'P', N'PC'))
DROP PROCEDURE [dbo].[_tblHtmlContent_GetIntroAtHomePage]
GO

CREATE PROCEDURE [dbo].[_tblHtmlContent_GetIntroAtHomePage]
(
	@LanguageId INT
)
AS
	SELECT *
	FROM tblHtmlContent 
	WHERE [TypeId] = 1
				AND (@LanguageId IS NULL OR [LanguageId] = @LanguageId)
GO
